#ifndef PROTEIN_H
#define PROTEIN_H

/**
 * The interface (header) file for the Protein class.
 *
 * @author Dejan Lekic <dejan.lekic@kcl.ac.uk
 */

#include <sstream> // ostringstream
#include <iomanip>
#include <vector>

#include <profo/AminoAcid.h>
#include <profo/ProteinIO.h>

namespace profo {

/**
 * One of the most important classes in the PROFO project - Protein class.
 * It is also a major building block of the MVC pattern the whole project is built
 * upon. An object of this type is a MODEL for our view(ers) and controller(s).
 *
 * Initially a Protein object does not contain any amino acid. We can either
 * populate it by using parseInput() method, or by adding individual amino
 * acids one-by-one using append() method.
 *
 * This class deals only with 2D grids for now.
 */
class Protein {
  public:
  // We will let compiler generate default constructor
  // METHODS
  void parseInput(const std::string& arg);
  void parseInput(const char* arg);
  void append(const AminoAcid& arg);
  int size() const { return _chain.size(); } ///< returns number of amino acids in the protein.
  std::string toString() const;
  void clear() { _chain.clear(); } ///< Empties the Protein object.
  bool adjacentTo(int argX, int argY, int argId);
  void move(unsigned int argId, unsigned char argMove);
#ifdef DEBUG
  static void unittest();
#endif
  // ACCESSORS
  AminoAcid& get(int arg);
  AminoAcid& getSelected() { return get(_selected); }
  int set(AminoAcid& argAcid, int argIdx);
  double energy() const { return _energy; } ///< Get current energy
  void energy(double arg) { _energy = arg; } ///< Set current energy
  std::string energyString() const;
  void description(const std::string& arg) { _description = arg; }
  const std::string& description() const { return _description; }
  void authors(const std::string& arg) { _authors = arg; }
  const std::string& authors() const { return _authors; }
  unsigned short selected() const { return _selected; }
  void selected(unsigned short arg) { _selected = arg; }

  private:
  // VARIABLES
  std::vector<AminoAcid> _chain;  ///< A vector which contains all amino acids in the protein.
  double _energy; ///< Current energy of the protein
  std::string _description; ///< String with the current algorithm's description.
  std::string _authors; ///< String that contains list of authors of authors
  unsigned short _selected; ///< ID of selected amino acid
}; // Protein class

} // profo namespace

// $Id: Protein.h 44 2009-04-26 14:39:06Z dejan.lekic $

#endif // PROTEIN_H
